import axios from "axios";
import { transformUrl } from '../utils/request';


// 获取地图数据
const getMapData = params => {
    // return axios({
    //     headers: {
    //         'Content-Type': 'application/json;charset=UTF-8',
    //     },
    //     method: 'get',
    //     url: transformUrl('/getMapData', params),
    // })
    return new Promise(function(resolve, reject) {
        resolve([
            { name: "北京", value: 20 },
            { name: "天津", value: 15 },
            { name: "上海", value: 15 },
            { name: "重庆", value: 15 },
            { name: "河北", value: 15 },
            { name: "河南", value: 15 },
            { name: "云南", value: 15 },
            { name: "辽宁", value: 15 },
            { name: "黑龙江", value: 30 },
            { name: "湖南", value: 30 },
            { name: "安徽", value: 30 },
            { name: "山东", value: 30 },
            { name: "新疆", value: 0 },
            { name: "江苏", value: 20 },
            { name: "浙江", value: 40 },
            { name: "江西", value: 10 },
            { name: "湖北", value: 11 },
            { name: "广西", value: 5 },
            { name: "甘肃", value: 0 },
            { name: "山西", value: 5 },
            { name: "内蒙古", value: 5 },
            { name: "陕西", value: 0 },
            { name: "吉林", value: 0 },
            { name: "福建", value: 0 },
            { name: "贵州", value: 0 },
            { name: "广东", value: 0 },
            { name: "青海", value: 0 },
            { name: "西藏", value: 0 },
            { name: "四川", value: 0 },
            { name: "宁夏", value: 0 },
            { name: "海南", value: 0 },
            { name: "台湾", value: 0 },
            { name: "香港", value: 0 },
            { name: "澳门", value: 0 },
            { name: "南海诸岛", value: 0 },
        ]);
    })
}

const getAnalysisLineData = param => {
    return new Promise(function(resolve, reject) {
        resolve([{
            name: '燃烧室异常',
            valueList: [{
                value: '12',
                xAxis: '一月'
            }, {
                value: '5',
                xAxis: '二月'
            }, {
                value: '14',
                xAxis: '三月'
            }, {
                value: '34',
                xAxis: '四月'
            }, {
                value: '23',
                xAxis: '五月'
            }, {
                value: '12',
                xAxis: '六月'
            }, {
                value: '21',
                xAxis: '八月'
            }, {
              value: '31',
              xAxis: '九月'
            }]
        }, {
            name: '输水管异常',
            valueList: [{
              value: '21',
              xAxis: '一月'
            }, {
              value: '33',
              xAxis: '二月'
            }, {
              value: '7',
              xAxis: '三月'
            }, {
              value: '5',
              xAxis: '四月'
            }, {
              value: '4',
              xAxis: '五月'
            }, {
              value: '21',
              xAxis: '六月'
            }, {
              value: '3',
              xAxis: '八月'
            }, {
              value: '12',
              xAxis: '九月'
            }]
        }, {
            name: '炉膛异常',
            valueList: [{
              value: '33',
              xAxis: '一月'
            }, {
              value: '21',
              xAxis: '二月'
            }, {
              value: '67',
              xAxis: '三月'
            }, {
              value: '14',
              xAxis: '四月'
            }, {
              value: '16',
              xAxis: '五月'
            }, {
              value: '25',
              xAxis: '六月'
            }, {
              value: '23',
              xAxis: '八月'
            }, {
              value: '21',
              xAxis: '九月'
            }]
        }])
    });
}

//能耗效率
const getAnalysisLineData2 = param => {
  return new Promise(function(resolve, reject) {
    resolve([ {
      name: '能耗',
      valueList: [{
        value: '91',
        xAxis: '一月'
      }, {
        value: '83',
        xAxis: '二月'
      }, {
        value: '97',
        xAxis: '三月'
      }, {
        value: '75',
        xAxis: '四月'
      }, {
        value: '65',
        xAxis: '五月'
      }, {
        value: '55',
        xAxis: '六月'
      }, {
        value: '64',
        xAxis: '八月'
      }, {
        value: '72',
        xAxis: '九月'
      }]
    }, {
      name: '效率',
      valueList: [{
        value: '97',
        xAxis: '一月'
      }, {
        value: '97',
        xAxis: '二月'
      }, {
        value: '89',
        xAxis: '三月'
      }, {
        value: '88',
        xAxis: '四月'
      }, {
        value: '93',
        xAxis: '五月'
      }, {
        value: '94',
        xAxis: '六月'
      }, {
        value: '87',
        xAxis: '八月'
      }, {
        value: '99',
        xAxis: '九月'
      }]
    }])
  });
}
const getScatterData = param => {
    return new Promise(function(resolve, reject) {
      resolve( [
        [
          [28604, '预警', 17096869, "Australia", '温度异常'],
          [31163, 77.4, 27662440, "Canada", '温度异常'],
          [1516, 68, 1154605773, "China", '燃烧室异常'],
          [13670, 74.7, 10582082, "Cuba", '燃烧室异常'],
          [28599, 75, 4986705, "Finland", '燃烧室异常'],
          [29476, 77.1, 56943299, "France", '燃烧室异常'],
          [31476, 75.4, 78958237, "Germany", '燃烧室异常'],
          [28666, 78.1, 254830, "Iceland", '燃烧室异常'],
          [1777, 57.7, 870601776, "India", '燃烧室异常'],
          [29550, 79.1, 122249285, "Japan", '燃烧室异常'],
          [2076, 67.9, 20194354, "North Korea", '燃烧室异常'],
          [12087, 72, 42972254, "South Korea", '燃烧室异常'],
          [24021, 75.4, 3397534, "New Zealand", '燃烧室异常'],
          [43296, 76.8, 4240375, "Norway", '燃烧室异常'],
          [10088, 70.8, 38195258, "Poland", '燃烧室异常'],
          [19349, 69.6, 147568552, "Russia", '燃烧室异常'],
          [10670, 67.3, 53994605, "Turkey", '燃烧室异常'],
          [26424, 75.7, 57110117, "United Kingdom", '燃烧室异常'],
          [37062, 75.4, 252847810, "United States", '燃烧室异常'],
        ],
        [
          [44056, 81.8, 23968973, "Australia", '输水管异常'],
          [43294, 81.7, 35939927, "Canada", '输水管异常'],
          [13334, 76.9, 1376048943, "China", '输水管异常'],
          [21291, 78.5, 11389562, "Cuba", '输水管异常'],
          [38923, 80.8, 5503457, "Finland", '输水管异常'],
          [37599, 81.9, 64395345, "France", '输水管异常'],
          [44053, 81.1, 80688545, "Germany", '输水管异常'],
          [42182, 82.8, 329425, "Iceland", '输水管异常'],
          [5903, 66.8, 1311050527, "India", '输水管异常'],
          [36162, 83.5, 126573481, "Japan", '输水管异常'],
          [1390, 71.4, 25155317, "North Korea", '输水管异常'],
          [34644, 80.7, 50293439, "South Korea", '输水管异常'],
          [34186, 80.6, 4528526, "New Zealand", '输水管异常'],
          [64304, 81.6, 5210967, "Norway", '输水管异常'],
          [24787, 77.3, 38611794, "Poland", '输水管异常'],
          [23038, 73.13, 143456918, "Russia", '输水管异常'],
          [19360, 76.5, 78665830, "Turkey", '输水管异常'],
          [38225, 81.4, 64715810, "United Kingdom", '输水管异常'],
          [53354, 79.1, 321773631, "United States", '输水管异常'],
        ],
      ])
    });
}

export {
    getMapData,
    getAnalysisLineData,
  getAnalysisLineData2,
    getScatterData
}
